<?php

class Country_Model_Newscategory extends Core_Model_Item_Abstract
{
  protected $_searchTriggers = false;
  
  public function getTitle()
  {
    return $this->category_name;
  }
  
  public function getUsedCount()
  {
    $newsTable = Engine_Api::_()->getItemTable('country_news');
    return $newsTable->select()
        ->from($newsTable, new Zend_Db_Expr('COUNT(news_id)'))
        ->where('category_id = ?', $this->category_id)
        ->query()
        ->fetchColumn();
  }

  public function isOwner($owner)
  {
    return false;
  }

  public function getOwner()
  {
    return $this;
  }
}